package com.zr.datamodel;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerators;
/**
 * 用户实体类
 * @author lym
 *
 */
@Entity
@Table(name="sys_user")
public class UserDM {

	private int id;
	
	private String account;
	
	private String password;
	
	private String name;
	
	private RoleDM role;
	
	private List<OrderDM> orders=new ArrayList<>();
	private List<PointDM> point=new ArrayList<>();
	@Id
	@GeneratedValue
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	@Column(name="account")
	public String getAccount() {
		return account;
	}

	public void setAccount(String account) {
		this.account = account;
	}

	@Column(name="password")
	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	@Column(name="name")
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@ManyToOne
	public RoleDM getRole() {
		return role;
	}

	public void setRole(RoleDM role) {
		this.role = role;
	}
	@OneToMany(mappedBy="user")
	public List<OrderDM> getOrders() {
		return orders;
	}

	public void setOrders(List<OrderDM> orders) {
		this.orders = orders;
	}
	@OneToMany(mappedBy="user")
	public List<PointDM> getPoint() {
		return point;
	}

	public void setPoint(List<PointDM> point) {
		this.point = point;
	}
	
}
